
#include "ConvectiveMCRadiationCoupleBC.h"
#include "libmesh/meshfree_interpolation.h"
#include "libmesh/system.h"
#include "libmesh/radial_basis_interpolation.h"

registerMooseObject("RoshanApp", ConvectiveMCRadiationCoupleBC);

template<>
InputParameters validParams<ConvectiveMCRadiationCoupleBC>()
{
	InputParameters params = validParams<IntegratedBC>();
	return params;
}

ConvectiveMCRadiationCoupleBC::ConvectiveMCRadiationCoupleBC(const InputParameters & parameters) :
	IntegratedBC(parameters),
	_convective_flux(getMaterialProperty<Real>("convection_heat_flux_hotwall")),
	_convective_flux_jacobi(getMaterialProperty<Real>("convection_heat_flux_hotwall_jacobi")),
	_mcradiation_flux(getMaterialProperty<Real>("MC_radiation_heat_flux")),
	_mcradiation_flux_jacobi(getMaterialProperty<Real>("MC_radiation_heat_flux_jacobi"))
{
}

Real ConvectiveMCRadiationCoupleBC::computeQpResidual()
{
	Real coupleflux = _mcradiation_flux[_qp] + _convective_flux[_qp];
	return -_test[_i][_qp] * coupleflux;
}

Real ConvectiveMCRadiationCoupleBC::computeQpJacobian()
{
	Real coupleflux_jacobi = _convective_flux_jacobi[_qp] + _mcradiation_flux_jacobi[_qp];
	return -_test[_i][_qp]*_phi[_j][_qp] * coupleflux_jacobi;
}


